<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class UserInfo extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'name'=>'required|min:2|max:25',
            'real_name'=>'required|min:2|max:4',
            'alipay' => 'required',
            'wechat' => 'required',           
        ];
    }

    public function messages()
    {
        return [
            
            'name.required'=>'请输入昵称',
            'name.min'=>'昵称最少2位',
            'name.max'=>'昵称最多25位',

            'real_name.required'=>'请输入真实姓名',
            'real_name.min'=>'姓名最少2位',
            'real_name.max'=>'姓名最多4位',

            'alipay.required'=>'请输入收款支付宝账号',

            'wechat.required'=>'请输入收款微信号',

        ];
    }
}
